home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11017 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: is getopt() ANSI and portable ?
  5. Date: 21 Mar 1996 08:54:36 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4irqjc$c2q@solutions.solon.com>
  8. References: <31512EC7.389F@eso.org>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <31512EC7.389F@eso.org>, Nicolas Devillard  <nDevil@eso.org> wrote:
  12. >I do not want to reinvent the wheel by creating again my own
  13. >command line parser. I found this getopt() function being part
  14. >of stdlib, but I'd like to know:
  15.  
  16. >1. If it is part of the ANSI C stdlib ?
  17.  
  18. No.
  19.  
  20. >2. If it is a portable call ? I cannot find it in the POSIX prog guide.
  21.  
  22. Not very.  It's widely available, but I don't think it's very standardized.
  23. POSIX may actually specify it now.  Not sure.
  24.  
  25. I wrote a portable implementation of this (it curretly uses getpwuid,
  26. but this can be elided with no trouble), which is really quite a bit different,
  27. but is mostly usage-compatible.  There's also something called "parseargs",
  28. which is a bit more Unix specific, but I'm not sure where you'd get it.
  29.  
  30. -s
  31. -- 
  32. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  33. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  34. FUCK the communications decency act.  Goddamned government.  [literally.]
  35. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  36.